{layout name="layout/login_head" /}
<content>
    <form method="post" action="{:Url('index/login/verify')}">
        <div>填写验证码</div>
        <div class="verify">
            <input onkeyup = "moveNext(this,0);" name="code[]" type="tel" maxlength="1" >
            <input onkeyup = "moveNext(this,1);" name="code[]" type="tel" maxlength="1">
            <input onkeyup = "moveNext(this,2);" name="code[]" type="tel" maxlength="1">
            <input onkeyup = "moveNext(this,3);" name="code[]" type="tel" maxlength="1">
        </div>
                <button id="sub" class="phone code" type="submit">登录</button>
    </form>
</content>
<script type="text/javascript">
  // 取消提示的http地址显示
    window.alert = function(name) {
        var iframe = document.createElement("IFRAME");
        iframe.style.display = "none";
        iframe.setAttribute("src", 'data:text/plain,');
        document.documentElement.appendChild(iframe);
        window.frames[0].window.alert(name);
        iframe.parentNode.removeChild(iframe);
    }
    $(function(){

    })


    function moveNext(object,index){

        if(object.value.length == 1){

            document.forms[0].elements[index+1].focus();
        }

    }
    function showResult(){

        var f = document.forms[0];
        var result="";

        for(var i = 0; i<1 ;i++){

            result += f.elements[i].value;
        }

        alert(result);

    }
</script>